﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;

namespace HoldemView
{
    public partial class ChartForm : Form
    {

        public ZedGraphControl Chart { get { return chrt; } }

        private bool _shouldRefresh = true;
        private Timer _timer;

        public bool ChartDirty { get { return _shouldRefresh; } set { _shouldRefresh = value; } }

        public ChartForm()
        {
            InitializeComponent();

            _timer = new Timer();
            _timer.Tick += new EventHandler(Timer_Tick);
            _timer.Interval = 1000;
            _timer.Start();
            chrt.Refresh();
        }

        void Timer_Tick(object sender, EventArgs e)
        {
            if (_shouldRefresh)
            {
                chrt.Refresh();
                _shouldRefresh = false;
            }
        }
    }
}
